<html><head><title>ExtractRegularExpression</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">ExtractRegularExpression()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>ExtractRegularExpression</b></font>(#RegularExpression, String$, Array$())</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Extracts strings according to the #RegularExpression into an array. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#RegularExpression</i></td>
<td width="90%"> 
The regular expression to use. 

</td></tr>
<tr><td><i>String$</i></td>
<td> 
The string to apply the regular expression on. 

</td></tr>
<tr><td><i>Array$()</i></td>
<td> 
The extracted strings will be stored in this array. The array is automatically resized 
to the number of element matching the expression found in the specified string. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns the number of elements matching the regular expression in the string. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#006666">; This expression will match every word of 3 letter which begin by a lower case letter,</font>
  <font color="#006666">; followed with the character 'b' and which ends with an uppercase letter. ex: abC</font>
  <font color="#006666">;    </font>
  <b><font color="#006666">If</font></b> <font color="#006666">CreateRegularExpression</font>(0, "[a-z]b[A-Z]")
    <b><font color="#006666">Dim</font></b> <font color="#006666">Result$</font>(0)
    NbFound =<font color="#006666"> ExtractRegularExpression</font>(0, "abC ABc zbA abc",<font color="#006666"> Result$</font>())
    <b><font color="#006666">For</font></b> k = 0 <b><font color="#006666">To</font></b> NbFound-1
      <b><font color="#006666">Debug</font></b> <font color="#006666">Result$</font>(k)
    <b><font color="#006666">Next</font></b>
  <b><font color="#006666">Else</font></b>
    <b><font color="#006666">Debug</font></b> <font color="#006666">RegularExpressionError</font>()
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="createregularexpression.html">CreateRegularExpression()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=examineregularexpression.html>ExamineRegularExpression()</a> - <a href=index.html>RegularExpression Index</a> - <a href=freeregularexpression.html>FreeRegularExpression()</a> ->

</body></html>